﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
using System.Globalization;
using System.ComponentModel;
using System.Windows.Threading;
using System.Threading;
using System.Diagnostics;
using System.Reflection;

namespace NeosSDI.MVC4.ProjectTemplateWizard
{
    /// <summary>
    /// Logique d'interaction pour MVC3NotInstalled.xaml
    /// </summary>
    public partial class MVC3NotInstalled : Window
    {
        System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
        public MVC3NotInstalled()
        {
            InitializeComponent();
            timer.Interval = 5000;
            timer.Tick += new EventHandler(timer_Tick);
        }

        void timer_Tick(object sender, EventArgs e)
        {
            Assembly assembly = Assembly.Load("System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            if (assembly != null)
            {
                textBloxkMvc.Text = "MVC3 is now installed on your system.";
                Skip.Content = "Continue";
            }
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Process.Start("http://www.microsoft.com/web/gallery/install.aspx?appid=MVC3");
            System.Threading.Thread.Sleep(500);
            this.Close();
        }

        private void Skip_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
